package com.webank.bean;



import java.io.Serializable;
import java.util.Arrays;

import static com.webank.utils.utils.MD5;

/**
 * Created by kantlin on 2018/7/26.
 */
public class Block implements Serializable {
    private String previousHash;
    private Record record;
    private String blockHash;

    public Block(String previousHash,Record record) {
        this.previousHash = previousHash;
        this.record = record;
        String str = MD5(record.getVIN())+""+previousHash;
        this.blockHash = MD5(str);

    }

    public String getPreviousHash() {
        return previousHash;
    }

    public Record getRecord() {
        return record;

    }
    public String getBlockHash() {
        return blockHash;
    }

    public void setBlockHash(String blockHash) {
        this.blockHash = blockHash;
    }

    public void setPreviousHash(String previousHash) {
        this.previousHash = previousHash;
    }
}
